﻿@model TDT.Land.Entity.Cat_BDSType
@*@using (@Html.BeginForm("ModifyCatLand", "CatLand", FormMethod.Post))
{*@
<form id="fCatBDSType" method="post">
<table class="tbEdit" cellpadding="0" cellspacing="0">
    <tr>
        <th style="width:150px">
        </th>
        <td>
        </td>
    </tr>
    <tr>
        <th>@Html.Label(Cat_BDSType.FieldName.Code.Translate())
        </th>
        <td>@Html.TextBoxFor(m => m.Code)
        </td>
    </tr>
    <tr>
        <th>@Html.Label(Cat_BDSType.FieldName.BDSTypeName.Translate())
        </th>
        <td>@Html.TextBoxFor(m => m.BDSTypeName)
        </td>
    </tr>
    <tr>
        <th>@Html.Label(Cat_BDSType.FieldName.BDSLandName.Translate())
        </th>
        <td>@Html.DropDownListFor(m => m.LandID, (List<SelectListItem>)ViewBag.sel_Search_BDS, new { style = "width:138px" })
        </td>
    </tr>
    <tr>
        <th>@Html.Label(Cat_BDSType.FieldName.Note.Translate())
        </th>
        <td>@Html.TextAreaFor(m => m.Note, new { style = "width:500px" })
        </td>
    </tr>
    <tr>
        <td colspan="2" align="center">
            @Html.HiddenFor(m => m.ID)
            @*<input type="button" value="Tạo mới" />*@ <a class="btn_boder btn_save" onclick="onsave()">
                Save</a> <a class="close btn_boder btn_cancel">Cancel</a>
        </td>
    </tr>
</table>
</form>
@*}
*@
<script type="text/javascript">
    function onsave() {
        $.ajax({
            type: 'POST', url: '/CatBDSType/CatBDSTypeAction', data: $('#fCatBDSType').serialize(), success: function (response) {

            switch (response) {
                case "True": // save fail                    
                    closePopup();
                    cusAlert("Save ok");
                    window.location.assign("/CatBDSType/CatBDSTypeList");
                    break;
                case "False": // Store code ton tai..                                    
                    cusAlert(" fail");
                    break;

                default:
                    hideLoading();
                    break;
            }
        }
        });
    }
</script>
